package generator;

import genes.Codon;
import genes.GeneSequence;

import java.io.IOException;
import java.util.List;

public class Strain {
	
	private String Sequence;
	private GeneSequence geneSequence;

	
	public Strain(String x) throws IOException{
		this.Sequence=x;
		this.geneSequence= new GeneSequence(this.getSequence());

	}

	public String getSequence() {
		return Sequence;
	}
	
	public int hammingDist(String x){
		int len= this.geneSequence.geneSequence.length();
		int hd=0;
		for(int i=0;i<len;i++){
			if(this.getSequence().charAt(i)!=x.charAt(i))
				hd++;
			
		}
		return hd;
	}
	
	public GeneSequence getGeneSequence() {
		return geneSequence;
	}
	
	public String getCodonSequence(){
		return this.getGeneSequence().printSequence();
	}
	
	public List<Codon> getAminoAcidSequence(){
	//	System.out.println("here");
		return this.getGeneSequence().getAaSequence();
	}

	public void setSequence(String sequence) throws IOException {
		this.geneSequence.clear();
		this.geneSequence.geneSequence=sequence;
		Sequence = sequence;
	}

	
	

	
	
	
}
